<template>
	<view class="wnl">
		<view>
			<uni-calendar :insert="true" :lunar="true" :start-date="'1900-1-1'" :end-date="'2100-12-31'"
				:showMonth="true" @change="change" />
		</view>
		<view class="list">
			<view class="lunartime">
				<p class="title">
					<text>{{listTime.data.lunar}}</text>
				</p>
				<p class="tgdz">
					<text>{{listTime.GanZhiYear}}{{listTime.zodiac}}年</text>
					<txet>{{listTime.GanZhiMonth}}月</txet>
					<text>{{listTime.GanZhiDay}}日</text>
					<text>{{listTime.Week}}</text>
				</p>
			</view>
			<view class="jiyi">
				<view class="ji">
					<view class="icon">
						<img src="../../static/image/yi.png" alt="" />
					</view>
					<view class="content">
						<text>{{listTime.data.luckyDay.yi.toString().replaceAll(","," ")}}</text>
					</view>
				</view>
				<view class="ji">
					<view class="icon">
						<img src="../../static/image/ji.png" alt="" />
					</view>
					<view class="content">
						<text>{{listTime.data.luckyDay.ji.toString().replaceAll(","," ")}}</text>
					</view>
				</view>
			</view>
			<view class="details">
				<view class="list_item">
					<view class="l">
						<text class="l_c">凶煞宜忌</text>
						<text>{{listTime.data.jsxs.xiongSha.toString().replaceAll(","," ")}}</text>
					</view>
					<view class="l">
						<text class="l_c">冲煞</text>
						<text>{{listTime.data.dayxiangchong.chongDesc}}</text>
					</view>
					
				</view>
				<view class="list_item">
					<view class="l">
						<text class="l_c">喜神</text>
						<text>{{listTime.data.positionJiShen.xiShen.position}}</text>
					</view>
					<view class="l">
						<text class="l_c">福神</text>
						<text>{{listTime.data.positionJiShen.fuShen.position}}</text>
					</view>
					
					
				</view>
				<view class="list_item">
					<view class="l">
						<text class="l_c">财神</text>
						<text>{{listTime.data.positionJiShen.caiShen.position}}</text>
					</view>
					<view class="l">
						<text class="l_c">阳贵</text>
						<text>{{listTime.data.positionJiShen.guiShen.yangDesc}}</text>
					</view>
					
					
				</view>
				<view class="list_item_taishen">
					<view class="l">
						<text class="l_c">胎神正方</text>
						<text>月胎神:{{listTime.data.positionTaiShen.month}} 日胎神: {{listTime.data.positionTaiShen.day}}</text>
					
					</view>
					
					
				</view>
				<view class="list_item_taishen">
					<view class="l">
						<text class="l_c">彭祖百忌</text>
						<text>{{listTime.data.pengZu.tianGan}}  {{listTime.data.pengZu.diZhi}}</text>
					
					</view>
					
					
				</view>
				<view class="list_item_taishen">
					<view class="l">
						<text class="l_c">吉神宜趋</text>
						<text>{{listTime.data.jsxs.jiShen.toString().replaceAll(","," ")}} </text>
					
					</view>
					
					
				</view>
				<view class="list_item_taishen">
					<view class="l">
						<text class="l_c">二十八星宿</text>
						<div>{{listTime.data.xingXiu.xiu}} {{listTime.data.xingXiu.shengXiao}}<span style="color:#d61540">({{listTime.data.xingXiu.lucky}})</span></div>
		
						
					</view>
					
					
				</view>
				<view class="list_item_taishen">
					<view class="l nayin">
						<text class="l_c">纳音</text>
						<div>
						<text class="g">[年]</text>
						<text>{{listTime.data.naYin.year}} </text>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<text class="g">[月]</text>
						<text>{{listTime.data.naYin.month}} </text>  
						&nbsp;&nbsp;&nbsp;&nbsp;
						<text class="g">[日]</text>
						<text>{{listTime.data.naYin.day}} </text>
						  &nbsp;&nbsp;&nbsp;&nbsp;
						<text class="g">[时]</text>
						<text>{{listTime.data.naYin.hour}} </text>
						</div>
					
					</view>
					
					
				</view>
				
			</view>
		<view class="lunartime" style="min-height: 40px;">
			<p class="title">	
				<text>{{listTime.time}}</text>	
			</p>
			<p style="text-align: center;"><text>时辰吉凶</text></p>
		</view>
		<view class="jiyi" style="margin-top: 0;height: auto;">
			<view class="ji">
				<view class="icon">
					<img src="../../static/image/yi.png" alt="" />
				</view>
				<view class="content">
					<text>{{listTime.data.luckyHour.yi.toString().replaceAll(","," ")}}</text>
				</view>
			</view>
			<view class="ji">
			
				<view class="icon">
					<img src="../../static/image/ji.png" alt="" />
				</view>
				<view class="content">
					<text>{{listTime.data.luckyHour.ji.toString().replaceAll(","," ")}}</text>
				</view>
			</view>
		</view>
		</view>
		
	</view>
</template>
<style lang="scss">
	page {

		background-color: $uni-bg-color-grey;
	}
@mixin rounded-corners {
 background-color: $uni-bg-color;
 min-height: 153rpx;
 margin-top: 15px;
 padding-top: 15px;
}
@mixin two{
	display: grid;
	grid-template-columns: 50% 50%;
	align-items: center;
	border: 1px solid #f5f5f5;
}
@mixin three{
	display: grid;
	grid-template-columns:33% 33% 33%;
	align-items: center;
	border-bottom: 1px solid #f5f5f5;
	
}
@mixin items{
	.l{
		display: grid;
		 grid-template-columns:80px auto;
		align-items: center;
		min-height: 50px;
		border-right: 1px solid #f5f5f5;
		text-align: center;
		.l_c{
			color: #b9a182;
			padding-left: 10rpx;
		}
	}
	.nayin{
	
		.g{
			color:#55c21b;
		}
		
	}
}
@mixin one{
	display: grid;
	grid-template-columns:100%;
	align-items: center;

}
	.wnl {
		.list {
			width: 100%;

		.lunartime {
				@include rounded-corners;
				.title {
					text-align: center;
					font-size: 36rpx;
					font-weight: 600;
					color: #d61540;
				}
				.tgdz{
					width: 70%;
					padding-top: 15px;
					margin: auto;
					display: flex;
					justify-content: space-around;
					text{
						font-size: 30rpx;
					}
				}
			}
		}
		.jiyi{
			@include rounded-corners;
			 min-height: 173rpx;
			.ji{
				display: grid;
			    grid-template-columns:60px auto;
				align-items: center;
				margin-top: 5px;
				padding-bottom: 5px;
				.icon{
					   
					    text-align: center;
						
					img{
						width: 60rpx;
						height: 60rpx;
					}
				}
				.content{
					text{
						color: #63b541;
							user-select: all;
					}
				}
			}
		}
		.details{
			@include rounded-corners;
			height: auto;
			.list_item{
			@include two;
				
				
				@include items;
				text{
					user-select: all;
				}
			}
			.list_item_taishen{
				@include one;
				border-bottom:1px solid #f5f5f5;
				@include items;
				text{
					user-select: all;
				}
				
			}
			.list_item_jishen{
			
				@include three;
				@include items;
				text{
					user-select: all;
				}
				
			}
		}
	}
</style>
<script>
	import {
		throttle
	} from '../../utils/request.js'
	export default {
		data() {
			return {
				listTime: {
					"code": 200,
					"msg": "获取成功",
					"time": "20240612 21:47:21",
					"zodiac": "龙",
					"GanZhiYear": "甲辰",
					"GanZhiMonth": "庚午",
					"GanZhiDay": "丁未",
					"GanZhiHour": "亥时",
					"NewYear": "2024",
					"NewMonth": "6",
					"NewDay": "12",
					"Week": "星期三",
					"worktime": 0,
					"term": "",
					"lunarYear": 2024,
					"lunarMonth": 4,
					"lunarDay": 7,
					"lunarHour": "12",
					"lunarMonthName": "五月",
					"lunarDayName": "初七",
					"lunarLeapMonth": 0,
					"solarFestival": "",
					"isBigMonth": true,
					"LiuRenMonth": "赤口",
					"LiuRenDay": "赤口",
					"LiuRenHour": "速喜",
					"data": {
						"solar": "20240612 21:47:22 闰年 星期三 双子座",
						"lunar": "二〇二四年五月初七",
						"festival": {
							"solarHoliday": [],
							"solarAnniversary": [],
							"lunarHoliday": [],
							"lunarAnniversary": [],
							"daoFestival": [],
							"foFestival": [
								"九毒日"
							]
						},
						"dao": "四七二一年五月初七",
						"fo": "二五六八年五月初七",
						"julianDay": 2460474.4078935185,
						"phase": "上弦月",
						"phenology": "鵙始鸣",
						"jieQi": {
							"prev": {
								"qi": "芒种",
								"time": "20240605 12:09:52"
							},
							"next": {
								"qi": "夏至",
								"time": "20240621 04:50:58"
							}
						},
						"climate": "芒种 二候",
						"yuan": "下元九运",
						"dayLu": "午命互禄",
						"LiuYao": "大安",
						"qiZheng": "水",
						"pengZu": {
							"tianGan": "丁不剃头头必生疮",
							"diZhi": "未不服药毒气入肠"
						},
						"baizi": {
							"year": "甲辰",
							"month": "庚午",
							"day": "丁未",
							"hour": "辛亥"
						},
						"naYin": {
							"year": "覆灯火",
							"month": "路旁土",
							"day": "天河水",
							"hour": "钗钏金"
						},
						"luckyDay": {
							"yi": [
								"嫁娶",
								"祭祀",
								"祈福",
								"出火",
								"开光",
								"求嗣",
								"出行",
								"拆卸",
								"开市",
								"交易",
								"立券",
								"挂匾",
								"入宅",
								"移徙",
								"安床",
								"栽种",
								"动土"
							],
							"ji": [
								"安葬",
								"行丧",
								"伐木",
								"作梁"
							]
						},
						"luckyHour": {
							"yi": [
								"无"
							],
							"ji": [
								"诸事不宜"
							]
						},
						"jsxs": {
							"jiShen": [
								"天愿",
								"守日",
								"吉期",
								"六合"
							],
							"xiongSha": [
								"复日",
								"八专",
								"勾陈"
							]
						},
						"dayxiangchong": {
							"day": "丁未",
							"gan": "辛",
							"zhi": "丑",
							"shengXiao": "牛",
							"sha": "西",
							"chongDesc": "羊日冲(辛丑)牛"
						},
						"xingXiu": {
							"xiu": "壁",
							"shengXiao": "獝",
							"lucky": "吉",
							"song": "壁星造作主增财，丝蚕大熟福滔天，奴婢自来人口进，开门放水出英贤，埋葬招财官品进，家中诸事乐陶然，婚姻吉利主贵子，早播名誉著祖鞭。"
						},
						"positionJiShen": {
							"guiShen": {
								"yangGui": "乾",
								"yangDesc": "西北",
								"yinGui": "兑",
								"yinDesc": "正西"
							},
							"xiShen": {
								"xi": "离",
								"position": "正南"
							},
							"fuShen": {
								"fu": "巽",
								"position": "东南"
							},
							"caiShen": {
								"cai": "坤",
								"position": "西南"
							}
						},
						"positionTaiShen": {
							"month": "占房床",
							"day": "仓库厕 房内东"
						},
						"positionTaiSui": {
							"year": {
								"eight": "巽",
								"position": "东南"
							},
							"month": {
								"eight": "艮",
								"position": "东北"
							},
							"day": {
								"eight": "巽",
								"position": "东南"
							}
						},
						"zhiXing": "除",
						"tianShen": {
							"day": "勾陈",
							"dayType": "黑道",
							"lucky": "凶"
						},
						"xunKong": {
							"year": "寅卯",
							"month": "戌亥",
							"day": "寅卯"
						},
						"nineStar": {
							"year": {
								"number": "三",
								"color": "碧",
								"wuXing": "木",
								"position": "震",
								"positionDesc": "正东",
								"beiDou": "天玑",
								"xuanKongName": "禄存",
								"xunKongLuck": "凶",
								"qiMenName": "天冲",
								"baiMen": "伤门",
								"qiMenLuck": "小吉",
								"yyqiMen": "阳",
								"taiYiName": "轩辕",
								"taiYiType": "安神",
								"song": "出入会轩辕，凡事必缠牵，相生全不美，相克更忧煎，远行多不利，博彩尽输钱，九天玄女法，句句不虚言。",
								"desc": "三碧木天玑",
								"detail": "三碧木 震(正东) 天玑 玄空[禄存 凶] 奇门[天冲 小吉 伤门 阳] 太乙[轩辕 安神]"
							},
							"month": {
								"number": "一",
								"color": "白",
								"wuXing": "水",
								"position": "坎",
								"positionDesc": "正北",
								"beiDou": "天枢",
								"xuanKongName": "贪狼",
								"xunKongLuck": "吉",
								"qiMenName": "天蓬",
								"baiMen": "休门",
								"qiMenLuck": "大凶",
								"yyqiMen": "阳",
								"taiYiName": "太乙",
								"taiYiType": "吉神",
								"song": "门中太乙明，星官号贪狼，赌彩财喜旺，婚姻大吉昌，出入无阻挡，参谒见贤良，此行三五里，黑衣别阴阳。",
								"desc": "一白水天枢",
								"detail": "一白水 坎(正北) 天枢 玄空[贪狼 吉] 奇门[天蓬 大凶 休门 阳] 太乙[太乙 吉神]"
							},
							"day": {
								"number": "二",
								"color": "黒",
								"wuXing": "土",
								"position": "坤",
								"positionDesc": "西南",
								"beiDou": "天璇",
								"xuanKongName": "巨门",
								"xunKongLuck": "凶",
								"qiMenName": "天芮",
								"baiMen": "死门",
								"qiMenLuck": "大凶",
								"yyqiMen": "阴",
								"taiYiName": "摄提",
								"taiYiType": "凶神",
								"song": "门前见摄提，百事必忧疑，相生犹自可，相克祸必临，死门并相会，老妇哭悲啼，求谋并吉事，尽皆不相宜，只可藏隐遁，若动伤身疾。",
								"desc": "二黒土天璇",
								"detail": "二黒土 坤(西南) 天璇 玄空[巨门 凶] 奇门[天芮 大凶 死门 阴] 太乙[摄提 凶神]"
							},
							"hour": {
								"number": "六",
								"color": "白",
								"wuXing": "金",
								"position": "乾",
								"positionDesc": "西北",
								"beiDou": "开阳",
								"xuanKongName": "武曲",
								"xunKongLuck": "吉",
								"qiMenName": "天心",
								"baiMen": "开门",
								"qiMenLuck": "大吉",
								"yyqiMen": "阴",
								"taiYiName": "青龙",
								"taiYiType": "吉神",
								"song": "神光跃青龙，财气喜重重，投入有酒食，赌彩最兴隆，更逢相生旺，休言克破凶，见贵安营寨，万事总吉同。",
								"desc": "六白金开阳",
								"detail": "六白金 乾(西北) 开阳 玄空[武曲 吉] 奇门[天心 大吉 开门 阴] 太乙[青龙 吉神]"
							}
						},
						"ZaoMaTou": {
							"TouLiang": "九鼠偷粮",
							"CaoZi": "草子九分",
							"GengTian": "十牛耕田",
							"HuaShou": "花收十二分",
							"ZhiShui": "一龙治水",
							"getTuoGu": "三马驮谷",
							"KanCan": "六姑看蚕",
							"GongZhu": "八屠共猪",
							"JiaTian": "甲田一分",
							"getFenBing": "三人分饼",
							"DeJin": "八日得金",
							"RenBing": "十一人三丙",
							"RenChu": "十一人四锄"
						}
					}
				}
			}
		},
		onLoad() {
			  this.getData()
			console.log(this.listTime.data.luckyDay.yi)
		},
		onShareAppMessage(res) {
				wx.showShareMenu({
				     withShareTicket: true,
				     menus: ['shareAppMessage', 'shareTimeline']
				    })
				return{
						title:"你有没有看黄历的习惯呢？",
					
						
				}
				
				},
				//2.分享到朋友圈
		onShareTimeline(){
		
			return {
				title: '你有没有看黄历的习惯呢',
			
				
			}
		},
		methods: {
			change(e) {
				let obj = {
					y: e.year,
					m: e.month,
					d: e.date
				}
				throttle(this.getData(obj), 2000)
			},
			confirm(e) {
				console.log(e);
			},
			getData(obj) {
				uni.showLoading({
					title: '加载中'
				})
				this.$api.wannianli(obj).then(res => {
					if(res.code==200){
						this.listTime = res;
					}else{
						
					uni.showToast({
							title:res.msg,
							icon:'noe'
						})
					}
					uni.hideLoading()
					
				})
			}
		}
	}
</script>